#ifndef _SERIAL_H__
#define _SERIAL_H__
#include "protocols/codec.h"
#include "bsp/uart.h"

typedef struct{
    frame_handler_t rx_handler;
    u32 rate;
    encoder_t enc;
    decoder_t dec;
}serial_t;

void serial_init(serial_t *serial);
int serial_send_data(serial_t *serial, u8 *buff, int len);
int serial_send_frame(serial_t *serial, u8 *header, int header_len, u8 *buff, int len);
#endif /* _SERIAL_H__ */